#pragma once
#include "BBTCP.h"

class EventHandler : public TCPEventHandler
{
public:
    virtual void onTcpAccept(IOCPService * pIOCPService, ENDPOINT_ID id, PTCP_CONN_INFO pConnInfo)
    {
        DbgPrint("%s", pIOCPService->getPrivate(id));
    }
    virtual void onTcpConnected(IOCPService * pIOCPService, ENDPOINT_ID id, PTCP_CONN_INFO pConnInfo)
    {
        DbgPrint("%s", pIOCPService->getPrivate(id));
    }
    virtual void onTcpClosed(IOCPService * pIOCPService, ENDPOINT_ID id)
    {
        DbgPrint("%s", pIOCPService->getPrivate(id));
    }
    virtual void onTcpReceive(IOCPService * pIOCPService, ENDPOINT_ID id, LPWSABUF pWsaBuffer)
    {
        DbgPrint("%s", pIOCPService->getPrivate(id));
        DbgPrint("%s", pWsaBuffer->buf);
    }
    virtual void onTcpCanSend(IOCPService * pIOCPService, ENDPOINT_ID id)
    {
        DbgPrint("%s", pIOCPService->getPrivate(id));
    }
};